require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

def fix_fb_react_native_spec(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'FBReactNativeSpec'
      target.build_configurations.each do |config|
        if config.name == 'Debug' or config.name == 'Release'
          config.build_settings['NODE_BINARY'] = '/usr/local/bin/node'
        end
      end
    end
  end
end

target 'example' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  pod 'react-native-ble-manager', :path => '../../'

  target 'exampleTests' do
    inherit! :complete
    # Pods for testing
  end

  use_native_modules!  

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  #use_flipper!
  post_install do |installer|
    react_native_post_install(installer)
    #  flipper_post_install(installer)
    fix_fb_react_native_spec(installer)
  end
end

